<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: EMAC         (Ethernet MAC)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ethif.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a>  </div>
  <div class="headertitle">
<div class="title">EMAC (Ethernet MAC)</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>Ethernet is a well-defined industry specification. </p>
<p>Ethernet MAC module transmits and receives IEEE 802.3 frames by connecting with the PHY device using MII/RMII/GMII or RGMII interface. Ethernet MAC also supports 10/100/1000 Transfer rates and IEEE 1588 time stamp feature. Infineon uses a third-party Ethernet MAC IP from Cadence GEM_GXL, which is a Gigabit Ethernet MAC.</p>
<dl class="section note"><dt>Note</dt><dd>Ethernet MAC does not support "Wake on Lan" feature. So when the system is in deep sleep, it can't receive any Rx frames.</dd></dl>
<p>Below block diagram shows the hardware and software partition inside the MCU. Ethernet MAC IP hardware directly interface with external ethernet PHY via MII or RMII or GMII or RGMII interface and MDIO interface is for configuring the Ethernet PHY chip/device. The software section consists of three major layers Ethernet PDL (Peripheral Driver Library), Connectivity Middleware, and Applications. Ethernet PDL implements low level driver for Ethernet MAC and a generic driver for the external Ethernet PHY chips.</p>
<div class="image">
<img src="ethernet_system.png" alt="ethernet_system.png"/>
<div class="caption">
Ethernet Block Diagram</div></div>
<p> The ETHIF driver is wrapper around Cadence's EMAC core driver. This is a network interface driver to Cadence core EMAC driver. It provides APIs to communicate with Ethernet IP. The PHY driver also uses this driver to communicate with PHY chip (via application). This driver has internal buffer management, handling callbacks from Cadence EMAC during transport, etc.</p>
<p>The functions and other declarations used in this driver are in cy_ethif.h. You can include cy_pdl.h (ModusToolbox only) to get access to all functions and declarations in the PDL.</p>
<h1><a class="anchor" id="group_ethif_tx_rx_programming"></a>
Tx/Rx Programming</h1>
<ol type="1">
<li>Make sure all the pins connected between MAC and PHY is configured properly.</li>
<li>Enable Interrupts for Ethernet queues. This is used to receive events from driver.</li>
<li>Initialize MAC using <a class="el" href="group__group__ethif__functions.html#ga2c93b65d36304f46ab4f81c6f12218dd">Cy_ETHIF_Init()</a> API.</li>
<li>Optionally set filters.</li>
<li>PHY chip is outside of silicon. Initialize PHY using EPHY driver. Some PHY chip needs configuration using it's proprietary(extended) registers. Fo this refer to PHY data sheet.</li>
<li>Wait for link to be up. This can be done using EPHY APIs.</li>
<li>Once is link is up, then transmit frame using <a class="el" href="group__group__ethif__functions.html#gaae018eae818f3ba90f988ec6b547e04b">Cy_ETHIF_TransmitFrame()</a> API.</li>
<li>The receive callback is called when there is any frame received by MAC. The receive callback is registered during <a class="el" href="group__group__ethif__functions.html#ga2c93b65d36304f46ab4f81c6f12218dd">Cy_ETHIF_Init()</a> API call.</li>
</ol>
<h1><a class="anchor" id="group_ethif_more_information"></a>
More Information</h1>
<p>Refer to the technical reference manual (TRM) and the device datasheet.</p>
<h1><a class="anchor" id="group_ethif_MISRA"></a>
MISRA-C Compliance</h1>
<p>The Ethernet driver has no specific deviations</p>
<h1><a class="anchor" id="group_ethif_changelog"></a>
Changelog</h1>
<table class="doxtable">
<tr>
<th>Version</th><th>Changes</th><th>Reason for Change </th></tr>
<tr>
<td>1.30 </td><td>Added an internal low power callback. </td><td>Code enhancement.  </td></tr>
<tr>
<td>1.20 </td><td>Documentation update and updated pre-processor check for CM55. </td><td>Code enhancement.  </td></tr>
<tr>
<td>1.10.1 </td><td>Build warning fixes due to redefinitions. </td><td>Bug fixes.  </td></tr>
<tr>
<td>1.10 </td><td>Updated an internal API and fixed MISRA 2012 violations. </td><td>MISRA 2012 compliance and code enhancement.  </td></tr>
<tr>
<td>1.0 </td><td>Initial version </td><td></td></tr>
</table>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__ethif__macros"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ethif__macros.html">Macros</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__ethif__functions"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ethif__functions.html">Functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__ethif__data__structures"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ethif__data__structures.html">Data Structures</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__ethif__enums"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ethif__enums.html">Enumerated Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
